using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using ACME.Northwind.DataTransfer;
using ACME.Northwind.DALProxy.Extensions;
using Widgetsphere.Core.Util;

namespace ACME.Northwind.WCFService
{
	// NOTE: If you change the class name "DataService" here, you must also update the reference to "DataService" in Web.config and in the associated .svc file.
	/// <summary>
	/// This WCF service allows you to interact with all generated objects
	/// </summary>
	public class DataService : IDataService
	{
		#region Category
		#region Category Select All

		/// <summary>
		/// Get a list of all Category DTO items
		/// </summary>
		public List<CategoryDTO> GetCategoryList()
		{
			List<CategoryDTO> retval = new List<CategoryDTO>();
			retval.RunSelect();
			return retval;
		}

		#endregion

		#region Category Select By Primary Key

		/// <summary>
		/// Get a single Category DTO item by primary key
		/// </summary>
		public CategoryDTO GetCategory(int categoryid)
		{
			CategoryDTO retVal = new CategoryDTO();
			retVal.SelectUsingPK(categoryid);
			return retVal;
		}

		#endregion

		#region Category select paged

		/// <summary>
		/// Get a paginated list of Category DTO items using LINQ
		/// </summary>
		public PagedQueryResults<CategoryDTO> GetCategoryListPaged(int pageIndex, int pageSize, bool sortOrder, string sortColumn, string linq)
		{
			List<CategoryDTO> dtoList = new List<CategoryDTO>();
			return dtoList.RunSelect(pageSize.ToString(), pageIndex.ToString(), sortOrder.ToString().ToLower(), sortColumn, linq);
		}

		#endregion

		#region Category Select by LINQ

		/// <summary>
		/// Get a list of Category DTO items using LINQ
		/// </summary>
		public List<CategoryDTO> GetCategoryListByLINQ(string linq)
		{
			List<CategoryDTO> dtoList = new List<CategoryDTO>();
			dtoList.RunSelect(linq);
			return dtoList;
		}

		#endregion

		#region Category Select by Column

		#endregion

		#region Category Select By Foreign Key

		#endregion

		#region Category Add Item

		/// <summary>
		/// Persist a single Category DTO item
		/// </summary>
		public CategoryDTO PersistCategory(CategoryDTO item)
		{
			return item.Persist();
		}

		#endregion

		#region Category Delete

		/// <summary>
		/// Delete a single Category item
		/// </summary>
		public bool DeleteCategory(CategoryDTO item)
		{
			return item.Delete();
		}

		#endregion
		#endregion

		#region CustomerCustomerDemo
		#region CustomerCustomerDemo Select All

		/// <summary>
		/// Get a list of all CustomerCustomerDemo DTO items
		/// </summary>
		public List<CustomerCustomerDemoDTO> GetCustomerCustomerDemoList()
		{
			List<CustomerCustomerDemoDTO> retval = new List<CustomerCustomerDemoDTO>();
			retval.RunSelect();
			return retval;
		}

		#endregion

		#region CustomerCustomerDemo Select By Primary Key

		/// <summary>
		/// Get a single CustomerCustomerDemo DTO item by primary key
		/// </summary>
		public CustomerCustomerDemoDTO GetCustomerCustomerDemo(string customerid, string customertypeid)
		{
			CustomerCustomerDemoDTO retVal = new CustomerCustomerDemoDTO();
			retVal.SelectUsingPK(customerid, customertypeid);
			return retVal;
		}

		#endregion

		#region CustomerCustomerDemo select paged

		/// <summary>
		/// Get a paginated list of CustomerCustomerDemo DTO items using LINQ
		/// </summary>
		public PagedQueryResults<CustomerCustomerDemoDTO> GetCustomerCustomerDemoListPaged(int pageIndex, int pageSize, bool sortOrder, string sortColumn, string linq)
		{
			List<CustomerCustomerDemoDTO> dtoList = new List<CustomerCustomerDemoDTO>();
			return dtoList.RunSelect(pageSize.ToString(), pageIndex.ToString(), sortOrder.ToString().ToLower(), sortColumn, linq);
		}

		#endregion

		#region CustomerCustomerDemo Select by LINQ

		/// <summary>
		/// Get a list of CustomerCustomerDemo DTO items using LINQ
		/// </summary>
		public List<CustomerCustomerDemoDTO> GetCustomerCustomerDemoListByLINQ(string linq)
		{
			List<CustomerCustomerDemoDTO> dtoList = new List<CustomerCustomerDemoDTO>();
			dtoList.RunSelect(linq);
			return dtoList;
		}

		#endregion

		#region CustomerCustomerDemo Select by Column

		#endregion

		#region CustomerCustomerDemo Select By Foreign Key

		/// <summary>
		/// Get a list of CustomerCustomerDemo DTO items by the CustomerDemographic foreign key
		/// </summary>
		public List<CustomerCustomerDemoDTO> GetCustomerCustomerDemoByCustomerDemographic(string customertypeid)
		{
			List<CustomerCustomerDemoDTO> retval = new List<CustomerCustomerDemoDTO>();
			retval.SelectByCustomerDemographic(customertypeid);
			return retval;
		}

		/// <summary>
		/// Get a list of CustomerCustomerDemo DTO items by the Customer foreign key
		/// </summary>
		public List<CustomerCustomerDemoDTO> GetCustomerCustomerDemoByCustomer(string customerid)
		{
			List<CustomerCustomerDemoDTO> retval = new List<CustomerCustomerDemoDTO>();
			retval.SelectByCustomer(customerid);
			return retval;
		}

		#endregion

		#region CustomerCustomerDemo Add Item

		/// <summary>
		/// Persist a single CustomerCustomerDemo DTO item
		/// </summary>
		public CustomerCustomerDemoDTO PersistCustomerCustomerDemo(CustomerCustomerDemoDTO item)
		{
			return item.Persist();
		}

		#endregion

		#region CustomerCustomerDemo Delete

		/// <summary>
		/// Delete a single CustomerCustomerDemo item
		/// </summary>
		public bool DeleteCustomerCustomerDemo(CustomerCustomerDemoDTO item)
		{
			return item.Delete();
		}

		#endregion
		#endregion

		#region CustomerDemographic
		#region CustomerDemographic Select All

		/// <summary>
		/// Get a list of all CustomerDemographic DTO items
		/// </summary>
		public List<CustomerDemographicDTO> GetCustomerDemographicList()
		{
			List<CustomerDemographicDTO> retval = new List<CustomerDemographicDTO>();
			retval.RunSelect();
			return retval;
		}

		#endregion

		#region CustomerDemographic Select By Primary Key

		/// <summary>
		/// Get a single CustomerDemographic DTO item by primary key
		/// </summary>
		public CustomerDemographicDTO GetCustomerDemographic(string customertypeid)
		{
			CustomerDemographicDTO retVal = new CustomerDemographicDTO();
			retVal.SelectUsingPK(customertypeid);
			return retVal;
		}

		#endregion

		#region CustomerDemographic select paged

		/// <summary>
		/// Get a paginated list of CustomerDemographic DTO items using LINQ
		/// </summary>
		public PagedQueryResults<CustomerDemographicDTO> GetCustomerDemographicListPaged(int pageIndex, int pageSize, bool sortOrder, string sortColumn, string linq)
		{
			List<CustomerDemographicDTO> dtoList = new List<CustomerDemographicDTO>();
			return dtoList.RunSelect(pageSize.ToString(), pageIndex.ToString(), sortOrder.ToString().ToLower(), sortColumn, linq);
		}

		#endregion

		#region CustomerDemographic Select by LINQ

		/// <summary>
		/// Get a list of CustomerDemographic DTO items using LINQ
		/// </summary>
		public List<CustomerDemographicDTO> GetCustomerDemographicListByLINQ(string linq)
		{
			List<CustomerDemographicDTO> dtoList = new List<CustomerDemographicDTO>();
			dtoList.RunSelect(linq);
			return dtoList;
		}

		#endregion

		#region CustomerDemographic Select by Column

		#endregion

		#region CustomerDemographic Select By Foreign Key

		#endregion

		#region CustomerDemographic Add Item

		/// <summary>
		/// Persist a single CustomerDemographic DTO item
		/// </summary>
		public CustomerDemographicDTO PersistCustomerDemographic(CustomerDemographicDTO item)
		{
			return item.Persist();
		}

		#endregion

		#region CustomerDemographic Delete

		/// <summary>
		/// Delete a single CustomerDemographic item
		/// </summary>
		public bool DeleteCustomerDemographic(CustomerDemographicDTO item)
		{
			return item.Delete();
		}

		#endregion
		#endregion

		#region Customer
		#region Customer Select All

		/// <summary>
		/// Get a list of all Customer DTO items
		/// </summary>
		public List<CustomerDTO> GetCustomerList()
		{
			List<CustomerDTO> retval = new List<CustomerDTO>();
			retval.RunSelect();
			return retval;
		}

		#endregion

		#region Customer Select By Primary Key

		/// <summary>
		/// Get a single Customer DTO item by primary key
		/// </summary>
		public CustomerDTO GetCustomer(string customerid)
		{
			CustomerDTO retVal = new CustomerDTO();
			retVal.SelectUsingPK(customerid);
			return retVal;
		}

		#endregion

		#region Customer select paged

		/// <summary>
		/// Get a paginated list of Customer DTO items using LINQ
		/// </summary>
		public PagedQueryResults<CustomerDTO> GetCustomerListPaged(int pageIndex, int pageSize, bool sortOrder, string sortColumn, string linq)
		{
			List<CustomerDTO> dtoList = new List<CustomerDTO>();
			return dtoList.RunSelect(pageSize.ToString(), pageIndex.ToString(), sortOrder.ToString().ToLower(), sortColumn, linq);
		}

		#endregion

		#region Customer Select by LINQ

		/// <summary>
		/// Get a list of Customer DTO items using LINQ
		/// </summary>
		public List<CustomerDTO> GetCustomerListByLINQ(string linq)
		{
			List<CustomerDTO> dtoList = new List<CustomerDTO>();
			dtoList.RunSelect(linq);
			return dtoList;
		}

		#endregion

		#region Customer Select by Column

		/// <summary>
		/// Get a list of Customer DTO items by the City field
		/// </summary>
		public List<CustomerDTO> GetCustomerByCityField(string city)
		{
			List<CustomerDTO> retval = new List<CustomerDTO>();
			retval.SelectByCityField(city);
			return retval;
		}

		#endregion

		#region Customer Select By Foreign Key

		#endregion

		#region Customer Add Item

		/// <summary>
		/// Persist a single Customer DTO item
		/// </summary>
		public CustomerDTO PersistCustomer(CustomerDTO item)
		{
			return item.Persist();
		}

		#endregion

		#region Customer Delete

		/// <summary>
		/// Delete a single Customer item
		/// </summary>
		public bool DeleteCustomer(CustomerDTO item)
		{
			return item.Delete();
		}

		#endregion
		#endregion

		#region Employee
		#region Employee Select All

		/// <summary>
		/// Get a list of all Employee DTO items
		/// </summary>
		public List<EmployeeDTO> GetEmployeeList()
		{
			List<EmployeeDTO> retval = new List<EmployeeDTO>();
			retval.RunSelect();
			return retval;
		}

		#endregion

		#region Employee Select By Primary Key

		/// <summary>
		/// Get a single Employee DTO item by primary key
		/// </summary>
		public EmployeeDTO GetEmployee(int employeeid)
		{
			EmployeeDTO retVal = new EmployeeDTO();
			retVal.SelectUsingPK(employeeid);
			return retVal;
		}

		#endregion

		#region Employee select paged

		/// <summary>
		/// Get a paginated list of Employee DTO items using LINQ
		/// </summary>
		public PagedQueryResults<EmployeeDTO> GetEmployeeListPaged(int pageIndex, int pageSize, bool sortOrder, string sortColumn, string linq)
		{
			List<EmployeeDTO> dtoList = new List<EmployeeDTO>();
			return dtoList.RunSelect(pageSize.ToString(), pageIndex.ToString(), sortOrder.ToString().ToLower(), sortColumn, linq);
		}

		#endregion

		#region Employee Select by LINQ

		/// <summary>
		/// Get a list of Employee DTO items using LINQ
		/// </summary>
		public List<EmployeeDTO> GetEmployeeListByLINQ(string linq)
		{
			List<EmployeeDTO> dtoList = new List<EmployeeDTO>();
			dtoList.RunSelect(linq);
			return dtoList;
		}

		#endregion

		#region Employee Select by Column

		#endregion

		#region Employee Select By Foreign Key

		/// <summary>
		/// Get a list of Employee DTO items by the Employee foreign key
		/// </summary>
		public List<EmployeeDTO> GetEmployeeByEmployee(int employeeid)
		{
			List<EmployeeDTO> retval = new List<EmployeeDTO>();
			retval.SelectByEmployee(employeeid);
			return retval;
		}

		#endregion

		#region Employee Add Item

		/// <summary>
		/// Persist a single Employee DTO item
		/// </summary>
		public EmployeeDTO PersistEmployee(EmployeeDTO item)
		{
			return item.Persist();
		}

		#endregion

		#region Employee Delete

		/// <summary>
		/// Delete a single Employee item
		/// </summary>
		public bool DeleteEmployee(EmployeeDTO item)
		{
			return item.Delete();
		}

		#endregion
		#endregion

		#region EmployeeTerritory
		#region EmployeeTerritory Select All

		/// <summary>
		/// Get a list of all EmployeeTerritory DTO items
		/// </summary>
		public List<EmployeeTerritoryDTO> GetEmployeeTerritoryList()
		{
			List<EmployeeTerritoryDTO> retval = new List<EmployeeTerritoryDTO>();
			retval.RunSelect();
			return retval;
		}

		#endregion

		#region EmployeeTerritory Select By Primary Key

		/// <summary>
		/// Get a single EmployeeTerritory DTO item by primary key
		/// </summary>
		public EmployeeTerritoryDTO GetEmployeeTerritory(int employeeid, string territoryid)
		{
			EmployeeTerritoryDTO retVal = new EmployeeTerritoryDTO();
			retVal.SelectUsingPK(employeeid, territoryid);
			return retVal;
		}

		#endregion

		#region EmployeeTerritory select paged

		/// <summary>
		/// Get a paginated list of EmployeeTerritory DTO items using LINQ
		/// </summary>
		public PagedQueryResults<EmployeeTerritoryDTO> GetEmployeeTerritoryListPaged(int pageIndex, int pageSize, bool sortOrder, string sortColumn, string linq)
		{
			List<EmployeeTerritoryDTO> dtoList = new List<EmployeeTerritoryDTO>();
			return dtoList.RunSelect(pageSize.ToString(), pageIndex.ToString(), sortOrder.ToString().ToLower(), sortColumn, linq);
		}

		#endregion

		#region EmployeeTerritory Select by LINQ

		/// <summary>
		/// Get a list of EmployeeTerritory DTO items using LINQ
		/// </summary>
		public List<EmployeeTerritoryDTO> GetEmployeeTerritoryListByLINQ(string linq)
		{
			List<EmployeeTerritoryDTO> dtoList = new List<EmployeeTerritoryDTO>();
			dtoList.RunSelect(linq);
			return dtoList;
		}

		#endregion

		#region EmployeeTerritory Select by Column

		#endregion

		#region EmployeeTerritory Select By Foreign Key

		/// <summary>
		/// Get a list of EmployeeTerritory DTO items by the Employee foreign key
		/// </summary>
		public List<EmployeeTerritoryDTO> GetEmployeeTerritoryByEmployee(int employeeid)
		{
			List<EmployeeTerritoryDTO> retval = new List<EmployeeTerritoryDTO>();
			retval.SelectByEmployee(employeeid);
			return retval;
		}

		/// <summary>
		/// Get a list of EmployeeTerritory DTO items by the Territory foreign key
		/// </summary>
		public List<EmployeeTerritoryDTO> GetEmployeeTerritoryByTerritory(string territoryid)
		{
			List<EmployeeTerritoryDTO> retval = new List<EmployeeTerritoryDTO>();
			retval.SelectByTerritory(territoryid);
			return retval;
		}

		#endregion

		#region EmployeeTerritory Add Item

		/// <summary>
		/// Persist a single EmployeeTerritory DTO item
		/// </summary>
		public EmployeeTerritoryDTO PersistEmployeeTerritory(EmployeeTerritoryDTO item)
		{
			return item.Persist();
		}

		#endregion

		#region EmployeeTerritory Delete

		/// <summary>
		/// Delete a single EmployeeTerritory item
		/// </summary>
		public bool DeleteEmployeeTerritory(EmployeeTerritoryDTO item)
		{
			return item.Delete();
		}

		#endregion
		#endregion

		#region OrderDetail
		#region OrderDetail Select All

		/// <summary>
		/// Get a list of all OrderDetail DTO items
		/// </summary>
		public List<OrderDetailDTO> GetOrderDetailList()
		{
			List<OrderDetailDTO> retval = new List<OrderDetailDTO>();
			retval.RunSelect();
			return retval;
		}

		#endregion

		#region OrderDetail Select By Primary Key

		/// <summary>
		/// Get a single OrderDetail DTO item by primary key
		/// </summary>
		public OrderDetailDTO GetOrderDetail(int orderid, int productid)
		{
			OrderDetailDTO retVal = new OrderDetailDTO();
			retVal.SelectUsingPK(orderid, productid);
			return retVal;
		}

		#endregion

		#region OrderDetail select paged

		/// <summary>
		/// Get a paginated list of OrderDetail DTO items using LINQ
		/// </summary>
		public PagedQueryResults<OrderDetailDTO> GetOrderDetailListPaged(int pageIndex, int pageSize, bool sortOrder, string sortColumn, string linq)
		{
			List<OrderDetailDTO> dtoList = new List<OrderDetailDTO>();
			return dtoList.RunSelect(pageSize.ToString(), pageIndex.ToString(), sortOrder.ToString().ToLower(), sortColumn, linq);
		}

		#endregion

		#region OrderDetail Select by LINQ

		/// <summary>
		/// Get a list of OrderDetail DTO items using LINQ
		/// </summary>
		public List<OrderDetailDTO> GetOrderDetailListByLINQ(string linq)
		{
			List<OrderDetailDTO> dtoList = new List<OrderDetailDTO>();
			dtoList.RunSelect(linq);
			return dtoList;
		}

		#endregion

		#region OrderDetail Select by Column

		#endregion

		#region OrderDetail Select By Foreign Key

		/// <summary>
		/// Get a list of OrderDetail DTO items by the Order foreign key
		/// </summary>
		public List<OrderDetailDTO> GetOrderDetailByOrder(int orderid)
		{
			List<OrderDetailDTO> retval = new List<OrderDetailDTO>();
			retval.SelectByOrder(orderid);
			return retval;
		}

		/// <summary>
		/// Get a list of OrderDetail DTO items by the Product foreign key
		/// </summary>
		public List<OrderDetailDTO> GetOrderDetailByProduct(int productid)
		{
			List<OrderDetailDTO> retval = new List<OrderDetailDTO>();
			retval.SelectByProduct(productid);
			return retval;
		}

		#endregion

		#region OrderDetail Add Item

		/// <summary>
		/// Persist a single OrderDetail DTO item
		/// </summary>
		public OrderDetailDTO PersistOrderDetail(OrderDetailDTO item)
		{
			return item.Persist();
		}

		#endregion

		#region OrderDetail Delete

		/// <summary>
		/// Delete a single OrderDetail item
		/// </summary>
		public bool DeleteOrderDetail(OrderDetailDTO item)
		{
			return item.Delete();
		}

		#endregion
		#endregion

		#region Order
		#region Order Select All

		/// <summary>
		/// Get a list of all Order DTO items
		/// </summary>
		public List<OrderDTO> GetOrderList()
		{
			List<OrderDTO> retval = new List<OrderDTO>();
			retval.RunSelect();
			return retval;
		}

		#endregion

		#region Order Select By Primary Key

		/// <summary>
		/// Get a single Order DTO item by primary key
		/// </summary>
		public OrderDTO GetOrder(int orderid)
		{
			OrderDTO retVal = new OrderDTO();
			retVal.SelectUsingPK(orderid);
			return retVal;
		}

		#endregion

		#region Order select paged

		/// <summary>
		/// Get a paginated list of Order DTO items using LINQ
		/// </summary>
		public PagedQueryResults<OrderDTO> GetOrderListPaged(int pageIndex, int pageSize, bool sortOrder, string sortColumn, string linq)
		{
			List<OrderDTO> dtoList = new List<OrderDTO>();
			return dtoList.RunSelect(pageSize.ToString(), pageIndex.ToString(), sortOrder.ToString().ToLower(), sortColumn, linq);
		}

		#endregion

		#region Order Select by LINQ

		/// <summary>
		/// Get a list of Order DTO items using LINQ
		/// </summary>
		public List<OrderDTO> GetOrderListByLINQ(string linq)
		{
			List<OrderDTO> dtoList = new List<OrderDTO>();
			dtoList.RunSelect(linq);
			return dtoList;
		}

		#endregion

		#region Order Select by Column

		#endregion

		#region Order Select By Foreign Key

		/// <summary>
		/// Get a list of Order DTO items by the Customer foreign key
		/// </summary>
		public List<OrderDTO> GetOrderByCustomer(string customerid)
		{
			List<OrderDTO> retval = new List<OrderDTO>();
			retval.SelectByCustomer(customerid);
			return retval;
		}

		/// <summary>
		/// Get a list of Order DTO items by the Employee foreign key
		/// </summary>
		public List<OrderDTO> GetOrderByEmployee(int employeeid)
		{
			List<OrderDTO> retval = new List<OrderDTO>();
			retval.SelectByEmployee(employeeid);
			return retval;
		}

		/// <summary>
		/// Get a list of Order DTO items by the Shipper foreign key
		/// </summary>
		public List<OrderDTO> GetOrderByShipper(int shipperid)
		{
			List<OrderDTO> retval = new List<OrderDTO>();
			retval.SelectByShipper(shipperid);
			return retval;
		}

		#endregion

		#region Order Add Item

		/// <summary>
		/// Persist a single Order DTO item
		/// </summary>
		public OrderDTO PersistOrder(OrderDTO item)
		{
			return item.Persist();
		}

		#endregion

		#region Order Delete

		/// <summary>
		/// Delete a single Order item
		/// </summary>
		public bool DeleteOrder(OrderDTO item)
		{
			return item.Delete();
		}

		#endregion
		#endregion

		#region Product
		#region Product Select All

		/// <summary>
		/// Get a list of all Product DTO items
		/// </summary>
		public List<ProductDTO> GetProductList()
		{
			List<ProductDTO> retval = new List<ProductDTO>();
			retval.RunSelect();
			return retval;
		}

		#endregion

		#region Product Select By Primary Key

		/// <summary>
		/// Get a single Product DTO item by primary key
		/// </summary>
		public ProductDTO GetProduct(int productid)
		{
			ProductDTO retVal = new ProductDTO();
			retVal.SelectUsingPK(productid);
			return retVal;
		}

		#endregion

		#region Product select paged

		/// <summary>
		/// Get a paginated list of Product DTO items using LINQ
		/// </summary>
		public PagedQueryResults<ProductDTO> GetProductListPaged(int pageIndex, int pageSize, bool sortOrder, string sortColumn, string linq)
		{
			List<ProductDTO> dtoList = new List<ProductDTO>();
			return dtoList.RunSelect(pageSize.ToString(), pageIndex.ToString(), sortOrder.ToString().ToLower(), sortColumn, linq);
		}

		#endregion

		#region Product Select by LINQ

		/// <summary>
		/// Get a list of Product DTO items using LINQ
		/// </summary>
		public List<ProductDTO> GetProductListByLINQ(string linq)
		{
			List<ProductDTO> dtoList = new List<ProductDTO>();
			dtoList.RunSelect(linq);
			return dtoList;
		}

		#endregion

		#region Product Select by Column

		#endregion

		#region Product Select By Foreign Key

		/// <summary>
		/// Get a list of Product DTO items by the Category foreign key
		/// </summary>
		public List<ProductDTO> GetProductByCategory(int categoryid)
		{
			List<ProductDTO> retval = new List<ProductDTO>();
			retval.SelectByCategory(categoryid);
			return retval;
		}

		/// <summary>
		/// Get a list of Product DTO items by the Supplier foreign key
		/// </summary>
		public List<ProductDTO> GetProductBySupplier(int supplierid)
		{
			List<ProductDTO> retval = new List<ProductDTO>();
			retval.SelectBySupplier(supplierid);
			return retval;
		}

		#endregion

		#region Product Add Item

		/// <summary>
		/// Persist a single Product DTO item
		/// </summary>
		public ProductDTO PersistProduct(ProductDTO item)
		{
			return item.Persist();
		}

		#endregion

		#region Product Delete

		/// <summary>
		/// Delete a single Product item
		/// </summary>
		public bool DeleteProduct(ProductDTO item)
		{
			return item.Delete();
		}

		#endregion
		#endregion

		#region Region
		#region Region Select All

		/// <summary>
		/// Get a list of all Region DTO items
		/// </summary>
		public List<RegionDTO> GetRegionList()
		{
			List<RegionDTO> retval = new List<RegionDTO>();
			retval.RunSelect();
			return retval;
		}

		#endregion

		#region Region Select By Primary Key

		/// <summary>
		/// Get a single Region DTO item by primary key
		/// </summary>
		public RegionDTO GetRegion(int regionid)
		{
			RegionDTO retVal = new RegionDTO();
			retVal.SelectUsingPK(regionid);
			return retVal;
		}

		#endregion

		#region Region select paged

		/// <summary>
		/// Get a paginated list of Region DTO items using LINQ
		/// </summary>
		public PagedQueryResults<RegionDTO> GetRegionListPaged(int pageIndex, int pageSize, bool sortOrder, string sortColumn, string linq)
		{
			List<RegionDTO> dtoList = new List<RegionDTO>();
			return dtoList.RunSelect(pageSize.ToString(), pageIndex.ToString(), sortOrder.ToString().ToLower(), sortColumn, linq);
		}

		#endregion

		#region Region Select by LINQ

		/// <summary>
		/// Get a list of Region DTO items using LINQ
		/// </summary>
		public List<RegionDTO> GetRegionListByLINQ(string linq)
		{
			List<RegionDTO> dtoList = new List<RegionDTO>();
			dtoList.RunSelect(linq);
			return dtoList;
		}

		#endregion

		#region Region Select by Column

		#endregion

		#region Region Select By Foreign Key

		#endregion

		#region Region Add Item

		/// <summary>
		/// Persist a single Region DTO item
		/// </summary>
		public RegionDTO PersistRegion(RegionDTO item)
		{
			return item.Persist();
		}

		#endregion

		#region Region Delete

		/// <summary>
		/// Delete a single Region item
		/// </summary>
		public bool DeleteRegion(RegionDTO item)
		{
			return item.Delete();
		}

		#endregion
		#endregion

		#region Shipper
		#region Shipper Select All

		/// <summary>
		/// Get a list of all Shipper DTO items
		/// </summary>
		public List<ShipperDTO> GetShipperList()
		{
			List<ShipperDTO> retval = new List<ShipperDTO>();
			retval.RunSelect();
			return retval;
		}

		#endregion

		#region Shipper Select By Primary Key

		/// <summary>
		/// Get a single Shipper DTO item by primary key
		/// </summary>
		public ShipperDTO GetShipper(int shipperid)
		{
			ShipperDTO retVal = new ShipperDTO();
			retVal.SelectUsingPK(shipperid);
			return retVal;
		}

		#endregion

		#region Shipper select paged

		/// <summary>
		/// Get a paginated list of Shipper DTO items using LINQ
		/// </summary>
		public PagedQueryResults<ShipperDTO> GetShipperListPaged(int pageIndex, int pageSize, bool sortOrder, string sortColumn, string linq)
		{
			List<ShipperDTO> dtoList = new List<ShipperDTO>();
			return dtoList.RunSelect(pageSize.ToString(), pageIndex.ToString(), sortOrder.ToString().ToLower(), sortColumn, linq);
		}

		#endregion

		#region Shipper Select by LINQ

		/// <summary>
		/// Get a list of Shipper DTO items using LINQ
		/// </summary>
		public List<ShipperDTO> GetShipperListByLINQ(string linq)
		{
			List<ShipperDTO> dtoList = new List<ShipperDTO>();
			dtoList.RunSelect(linq);
			return dtoList;
		}

		#endregion

		#region Shipper Select by Column

		#endregion

		#region Shipper Select By Foreign Key

		#endregion

		#region Shipper Add Item

		/// <summary>
		/// Persist a single Shipper DTO item
		/// </summary>
		public ShipperDTO PersistShipper(ShipperDTO item)
		{
			return item.Persist();
		}

		#endregion

		#region Shipper Delete

		/// <summary>
		/// Delete a single Shipper item
		/// </summary>
		public bool DeleteShipper(ShipperDTO item)
		{
			return item.Delete();
		}

		#endregion
		#endregion

		#region Supplier
		#region Supplier Select All

		/// <summary>
		/// Get a list of all Supplier DTO items
		/// </summary>
		public List<SupplierDTO> GetSupplierList()
		{
			List<SupplierDTO> retval = new List<SupplierDTO>();
			retval.RunSelect();
			return retval;
		}

		#endregion

		#region Supplier Select By Primary Key

		/// <summary>
		/// Get a single Supplier DTO item by primary key
		/// </summary>
		public SupplierDTO GetSupplier(int supplierid)
		{
			SupplierDTO retVal = new SupplierDTO();
			retVal.SelectUsingPK(supplierid);
			return retVal;
		}

		#endregion

		#region Supplier select paged

		/// <summary>
		/// Get a paginated list of Supplier DTO items using LINQ
		/// </summary>
		public PagedQueryResults<SupplierDTO> GetSupplierListPaged(int pageIndex, int pageSize, bool sortOrder, string sortColumn, string linq)
		{
			List<SupplierDTO> dtoList = new List<SupplierDTO>();
			return dtoList.RunSelect(pageSize.ToString(), pageIndex.ToString(), sortOrder.ToString().ToLower(), sortColumn, linq);
		}

		#endregion

		#region Supplier Select by LINQ

		/// <summary>
		/// Get a list of Supplier DTO items using LINQ
		/// </summary>
		public List<SupplierDTO> GetSupplierListByLINQ(string linq)
		{
			List<SupplierDTO> dtoList = new List<SupplierDTO>();
			dtoList.RunSelect(linq);
			return dtoList;
		}

		#endregion

		#region Supplier Select by Column

		#endregion

		#region Supplier Select By Foreign Key

		#endregion

		#region Supplier Add Item

		/// <summary>
		/// Persist a single Supplier DTO item
		/// </summary>
		public SupplierDTO PersistSupplier(SupplierDTO item)
		{
			return item.Persist();
		}

		#endregion

		#region Supplier Delete

		/// <summary>
		/// Delete a single Supplier item
		/// </summary>
		public bool DeleteSupplier(SupplierDTO item)
		{
			return item.Delete();
		}

		#endregion
		#endregion

		#region Territory
		#region Territory Select All

		/// <summary>
		/// Get a list of all Territory DTO items
		/// </summary>
		public List<TerritoryDTO> GetTerritoryList()
		{
			List<TerritoryDTO> retval = new List<TerritoryDTO>();
			retval.RunSelect();
			return retval;
		}

		#endregion

		#region Territory Select By Primary Key

		/// <summary>
		/// Get a single Territory DTO item by primary key
		/// </summary>
		public TerritoryDTO GetTerritory(string territoryid)
		{
			TerritoryDTO retVal = new TerritoryDTO();
			retVal.SelectUsingPK(territoryid);
			return retVal;
		}

		#endregion

		#region Territory select paged

		/// <summary>
		/// Get a paginated list of Territory DTO items using LINQ
		/// </summary>
		public PagedQueryResults<TerritoryDTO> GetTerritoryListPaged(int pageIndex, int pageSize, bool sortOrder, string sortColumn, string linq)
		{
			List<TerritoryDTO> dtoList = new List<TerritoryDTO>();
			return dtoList.RunSelect(pageSize.ToString(), pageIndex.ToString(), sortOrder.ToString().ToLower(), sortColumn, linq);
		}

		#endregion

		#region Territory Select by LINQ

		/// <summary>
		/// Get a list of Territory DTO items using LINQ
		/// </summary>
		public List<TerritoryDTO> GetTerritoryListByLINQ(string linq)
		{
			List<TerritoryDTO> dtoList = new List<TerritoryDTO>();
			dtoList.RunSelect(linq);
			return dtoList;
		}

		#endregion

		#region Territory Select by Column

		#endregion

		#region Territory Select By Foreign Key

		/// <summary>
		/// Get a list of Territory DTO items by the Region foreign key
		/// </summary>
		public List<TerritoryDTO> GetTerritoryByRegion(int regionid)
		{
			List<TerritoryDTO> retval = new List<TerritoryDTO>();
			retval.SelectByRegion(regionid);
			return retval;
		}

		#endregion

		#region Territory Add Item

		/// <summary>
		/// Persist a single Territory DTO item
		/// </summary>
		public TerritoryDTO PersistTerritory(TerritoryDTO item)
		{
			return item.Persist();
		}

		#endregion

		#region Territory Delete

		/// <summary>
		/// Delete a single Territory item
		/// </summary>
		public bool DeleteTerritory(TerritoryDTO item)
		{
			return item.Delete();
		}

		#endregion
		#endregion

	}

}
